home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Varie / IE_Errors.h < prev    next >
Encoding:
Text File  |  1997-06-17  |  1.4 KB  |  54 lines

  1. /*
  2.     IE_Errors.h
  3.  
  4.     This file contains the error strings and the error routine
  5.     used by the Main file generated by the C.generator.
  6.  
  7.     You can modify the strings and the Error routine as you like.
  8.  
  9.     NOTE: the Error routine MUST receive two STRPTR as arguments.
  10. */
  11.  
  12. STRPTR ErrStrings[] = {
  13.                 "Couldn't open ",
  14.                 "Couldn't open a diskfont!",
  15.                 "Setup Screen Error: ",
  16.                 "Couldn't open the screen!",
  17.                 "Couldn't get Visual Info!",
  18.                 "Open Window Error: ",
  19.                 "Couldn't create a context!",
  20.                 "Couldn't create a gadget!",
  21.                 "Couldn't create a menu!",
  22.                 "Couldn't open the window!"
  23. };
  24.  
  25. #define OPEN_LIB                0
  26. #define OPEN_FONTS              1
  27. #define SETUP_SCR               2
  28. #define OPEN_WND                SETUP_SCR+3
  29.  
  30. void Error(STRPTR str, STRPTR str2)
  31. {
  32.     TEXT c[ 256 ] = "";
  33.  
  34.     sprintf( c, "%s %s", str, str2 );
  35.  
  36.     if( WBMsg ) {   // this requires the 'Workbench' checkbox to be checked
  37.  
  38.         fprintf( stderr, "\n%s\n", c );
  39.  
  40.       } else {
  41.  
  42.         struct IntuiText error_text = {
  43.            0, 0, JAM1, 0, 10, NULL, c, NULL };
  44.  
  45.         static struct IntuiText ok_text = {
  46.            0, 0, JAM1, 0, 0, NULL, "OK", NULL };
  47.  
  48.         if( IntuitionBase )
  49.             AutoRequest( NULL, &error_text, NULL, &ok_text, 0, 0, 0, 0 );
  50.     }
  51.  
  52.     End( RETURN_FAIL );
  53. }
  54.